% TEST_ID: LANG-EXPAND-0078
% CATEGORY: stdlib/arithmetic_ops/bitops
% 测试 bitget 函数
function test_bit_bitget()

A = -29;
b = bitget(A,32:-1:1,'int32');

assert(length(b) == 32)
assert(isa(b, 'double'))

assert(b(end-8:end) == [ 1  1  1  1  0  0  0  1  1])

x = bitget(cast(0x001, 'uint64'), 1);
assert(x == 1)
assert(isa(x, 'uint64'))

x = bitget(cast(0x001, 'uint16'), 1);
assert(x == 1)
assert(isa(x, 'uint16'))

end